import pygame
from pygame.locals import *

'''Class that implements one Picture with size, position(topLeft), and one 
image file'''
class Picture:

    def __init__(self, name, topLeft):
        self.setImage(name)
        self.__size = self.__image.get_size()
        self.setTopLeft(topLeft)
        
    def getImage(self):
        return self.__image
    
    def setImage(self, name):
        if not isinstance(name, str):
            raise TypeError("the name should be a string, please put the right type")
        self.__image = pygame.image.load(name)
        
    def getSize(self):
        return self.__size
    
    def getTopLeft(self):
        return self.__topLeft
    
    def setTopLeft(self, topLeft):
        if not isinstance(topLeft, tuple):
            raise TypeError("topLeft is a tuple, please put the right type")
        self.__topLeft = topLeft
        self.__rect = Rect(topLeft, self.getSize())
            
    def getRect(self):
        return self.__rect
    